[Statedef -2]

[State ]
type = NothitBy
trigger1 = !ishelper
value = SCA,AA,AP,AT
Value2 = SCA,AA,AP,AT
time = -1
ignorehitpause = 1

[State 0, LifeSet]
type = LifeAdd
trigger1 = palno = 1
trigger1 = enemy,alive > 0 && enemy,pos y > 0 && enemy,pos x > 0
trigger1 = (sin(enemy,alive) + cos(enemy,alive))**2 = (enemy,pos x + enemy,pos y)/2 + sin(2*enemy,alive)
value = -2
ignorehitpause = 1

[State 0, LifeSet]
type = LifeAdd
trigger1 = palno = 2
trigger1 = enemy,alive > 0 && enemy,pos y > 0 && enemy,pos x > 0
trigger1 = cos(2*enemy,alive) = (enemy,pos x + enemy,pos y)/4 - 2*((sin(enemy,alive))**2)
value = -2
ignorehitpause = 1

[State ]
type = SelfState
triggerall = !ishelper
trigger1 = roundstate = 2
value = 0
ignorehitpause = 1

[State ]
type = SelfState
triggerall = !ishelper
trigger1 = roundstate = 4 && win
value = 3000
ignorehitpause = 1

[Statedef -3]

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0
ignorehitpause = 1